/*
 * @Author: lijunqing
 * @Date: 2024-04-22 13:59:58
 * @LastEditors: lijunqing
 * @LastEditTime: 2024-04-22 14:00:07
 * @Description:
 */
const express = require("express");

const app = express();

// 注册中间件: 对path/method都有限制
// app.method(path, middleware)
app.get("/home", (req, res, next) => {
  console.log("match /home get method middleware");
  res.end("home data");
});

app.post("/users", (req, res, next) => {
  console.log("match /users post method middleware");
  res.end("create user success");
});

app.listen(9000, () => {
  console.log("express服务器启动成功~");
});
